<template>
  <div class="artist-item">
    <img :src="coverUrl" alt="banner" class="artist-banner" />
    <!-- avatar -->
    <div class="artist-avatar-container">
      <img :src="avatarUrl" alt="avatar" class="artist-avatar" />
    </div>

    <div class="artist-name">{{ nickName }}</div>
    <div class="artist-desc">{{ description }}</div>
  </div>
</template>

<script>
import { defineComponent, ref } from "vue";
export default defineComponent({
  props: {
    navLink: {
      type: String,
      required: false,
    },
    coverUrl: {
      type: String,
      required: true,
    },
    avatarUrl: {
      type: String,
      required: true,
    },
    nickName: {
      type: String,
      required: true,
    },
    description: {
      type: String,
      required: true,
    },
  },
  setup(props, ctx) {
    let coverUrl = ref(props.coverUrl);
    let avatarUrl = ref(props.avatarUrl);
    let nickName = ref(props.nickName);
    let description = ref(props.description);
    return {
      coverUrl,
      avatarUrl,
      nickName,
      description
    };
  },
});
</script>
<style>
.artist-banner {
  margin: 10px auto;
  width: 98%;
  max-height: 100%;
  height: 110px;
  box-sizing: border-box;
  border-radius: 4px;
  object-fit: cover;
  background: gray;
}
.artist-avatar-container {
  margin: 0px auto;
  min-width: 0px;
  bottom: 0px;
  border-radius: 50%;
  background-color: rgb(255, 255, 255);
  transform: translate3d(0, -50%, 0);
  box-sizing: content-box;
  width: 74px;
  height: 74px;
  padding: 7px;
}
.artist-avatar {
  box-sizing: border-box;
  margin: 0px 8px 0px 0px;
  min-width: 0px;
  max-width: 100%;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  width: 100%;
  height: 100%;
}
.artist-name {
  box-sizing: border-box;
  margin: -20px 20px 20px;
  min-width: 0px;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  color: rgb(30, 35, 41);
}
.artist-desc {
  box-sizing: border-box;
  margin: 16px 0px 0px;
  min-width: 0px;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: rgb(112, 122, 138);
  overflow-wrap: break-word;
  text-align: center;
}
</style>
